<%@page pageEncoding="UTF-8" contentType="text/html; charset=UTF-8" errorPage="../error/errorpage.jsp"%>
<%@page language = "Java" import = "java.io.*" import="java.util.*"%>
<%@page import="beans.BeanLoginUser, mapping.Usuario, mapping.Idioma"%>
<jsp:useBean id="mybean" class="beans.BeanLoginUser"/>
	<%
		mybean.conectar(); 
		// obtenemos los parametros del formulario de registro
		List params = new LinkedList();
		String user = request.getParameter("user");
		if(user.length() > 0 && !user.contains("@gmail.com")) {
			user+="@gmail.com";
		}
		params.add(user);
		params.add(request.getParameter("nombre"));
		params.add(request.getParameter("apell"));
		params.add(request.getParameter("email"));
		params.add(request.getParameter("idioma"));
		if(mybean.insertaUsuario(params))
		out.println("Se ha registrado correctamente");
        mybean.desconectar();
        %>
